let app = getApp();
function goToLive(live){
  // 拿到平台
  let platform = live.roomInfo.platform;
  // 拿到userid
  let liveUserId = live.userInfo.userId;
  // 拿到房间的直播连接
  let link = live.roomInfo.link;
  if (platform == 'huajiao') {
    let linkId = live.roomInfo.extra.liveId;
    link = 'http://h.open.huajiao.com/l/index?liveid=' + linkId
  } else {
    link = link;
  }
  app.globalData.link = link;
  my.navigateTo({
    url: '/pages/live/info/info?platform=' + platform + '&liveUserId=' + liveUserId,
  })
}

module.exports = {
  goToLive:goToLive
}